package com.briup.jdbc;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class JdbcUtilsTest {
    public static void main(String[] args) {
        Connection conn = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        conn =  JdbcUtils.getDruidConnection();
        String sql = "select count(*) from t_user";
        try {
            ps  = conn.prepareStatement(sql);
            rs = ps.executeQuery();
            rs.next();
            int anInt = rs.getInt(1);
            System.out.println(anInt);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        } finally {
            JdbcUtils.close(conn,ps,rs);
        }
    }
}
